package com.ruoyi.project.exam.controller;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.exam.domain.ExamModel;
import com.ruoyi.project.exam.domain.UserExamModel;
import com.ruoyi.project.exam.service.IUserExamService;

@Controller
@RequestMapping("/exam/userExam")
public class UserExamController extends BaseController{
	private String prefix = "exam/userExam";
	@Autowired
	private IUserExamService userExamService;
	
	@RequiresPermissions("exam:userExam:view")
	@GetMapping()
	public String userExam(ModelMap mmap){
		return prefix+"/userExam";
	}
	
	/**
	 * 查询列表
	 */
	@RequiresPermissions("exam:userExam:list")
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(UserExamModel model) {
		startPage();
		List<UserExamModel> list = userExamService.selectUserExamList(model);
		return getDataTable(list);
	}
	
}
